home *** CD-ROM | disk | FTP | other *** search
- ' This is the third macro in the 600 series, which creates the
- ' large material boxes.
- '
- ' Get Values from data file.
- '
- ' Based on RType chosen by user above
- open "i", 1, "*\sample macros\600.txt"
- ' Assign #s found to Variables
- Input #1, AddLen
- Input #1, TH
- Input #1, PanNum2
- Input #1, PanNum
- ' Close File
- Close #1
- '
- ' Routine to Calculate values for Large Info Boxes
- Calc1:
- ' Calculate and display MTee
- Precision 2
- MTeeN = Area1 * 0.286
- MTeeC = MTeeN / 25
- MTeeN2 = ROUND(MTeeN)
- ' MTeeC2 = ROUND(MTeeC)
- MTemp = MTeeC + .5
- MTeeC2 = ROUND(MTemp)
- '
- ' Calculate and display 1.2CN
- CN12 = Area1 * 1.65
- CNC12 = CN12 / 75
- ' CN122 = CN12
- CN122 = ROUND(CN12)
- ' CNC122 = CNC12
- CTemp = CNC12 + .5
- CNC122 = ROUND(CTemp)
- '
- ' Calculate and display 1.6CN
- CN6 = Area1 * 1.61
- CN6C = CN6 / 75
- CN62 = ROUND(CN6)
- ' CN62 = ROUND(CN6)
- ' CN6C2 = CN6C
- C6Temp = CN6C + .5
- CN6C2 = ROUND(C6Temp)
- '
- ' Calculate and display ST Fix
- STFix = Area1 * 0.765
- STFixC = STFix / 100
- STFixD = STFixC + .5
- 'STFixC = ROUND(STFixD)
- STFixC2 = STFixC
- STFix2 = ROUND(STFix)
- ' Calculate and display Rods T
- RodsT = Area1 * 0.765
- RodsTC = RodsT / 100
- RodsTD = RodsTC + .5
- 'RodsTC = ROUND(RodsTD)
- RodsTC2 = RodsTC
- ' Calculate and display Rods B
- RodsB = Area1 * 0.765
- RodsBC = RodsB / 100
- RodsBD = RodsBC + .5
- 'RodsBC = ROUND(RodsBD)
- RodsBC2 = RodsBC
- ' Calculate and display Channel
- ' Apply Channel Adjustment from Earlier
- Chan = Chan + AddLen
- Chan = Len1 / 3
- Chan2 = ROUND(Chan)
- Chan2C = Chan / 24
- 'ChTemp = Chan2C + .5
- 'Chan2C = ROUND(ChTemp)
- ' Resolve Panel Choice for the user
- Panel = .36
- ' Calculate and display Panels
- Ar = Area1 * 0.065
- Pan1 = Area1 + Ar
- Pan2 = Pan1 / Panel
- Pan3 = Pan2
- Precision 2
- ' Apply Panel Reduction
- Pan3 = Pan3 - PanNum2
- Precision 2
- PTemp = Pan3 + .05
- ' Pan3 = ROUND(PTemp)
- '
- ' Section to Create Large Info Box
- Info1:
- ' Silent Mode On
- Sys(36) = 1
- '
- ' Open New DesignCAD Drawing
- >New
- {
- }
- '
- ' Make Layer 11 the current layer
- Layer(11) = 14
- '
- ' Create String Variables for Text Block
- ' Variables in the No. Column need to be integers only
- Precision 0
- MTeeN2$ = MTeeN2
- CNC122$ = CN122
- CN62$ = CN62
- STFix2$ = STFix
- RodsT2$ = RodsT
- RodsB2$ = RodsB
- Chan2$ = Chan2
- ' Variables in the CTS column need one place precision
- Precision 1
- ' Straight Unmodified Variables
- MTeeC2$ = MTeeC
- CN122$ = CNC12
- CN6C2$ = CN6C
- STFixC2$ = STFixC
- RodsTC2$ = RodsTC
- RodsBC2$ = RodsBC
- Chan2C$ = Chan2C
- Pan3$ = Pan3
- ' Rounded Variables
- ' MTeeC2$ = MTeeC2
- ' CN122$ = CNC122
- ' CN6C2$ = CN6C2
- ' STFixC2$ = STFixC2
- ' RodsTC2$ = RodsTC2
- ' RodsBC2$ = RodsBC2
- ' Chan2C$ = Chan2C
- ' Pan3$ = Pan3
- '
- ' Half Text height
- HTH = TH / 2
- ' Set Spacing for all text blocks at 1, DO NOT CHANGE THIS !!
- SP = 1
- ' Default Value
- Six = 1
- ' Draw First Labels for Info Box
- if Six = 1 then
- ' Text Block with 0.6
- >TextBlock
- {
- <Style 0
- <size [TH]
- <Distance [SP]
- <TextBegin
- <Text " "
- <Text " T "
- <Text "1.2 "
- <Text "0.6 "
- <Text "Fix "
- <Text "T R "
- <Text "B R "
- <Text "Ch "
- <justification 1
- <pointxyz 0, 0, 0
- }
- else
- ' Text Block without 0.6
- >TextBlock
- {
- <Distance [SP]
- <TextBegin
- <Text " "
- <Text " T "
- <Text "1.2 "
- <Text " "
- <Text "Fix "
- <Text "T R "
- <Text "B R "
- <Text "Ch "
- <justification 1
- <pointxyz 0, 0, 0
- }
- end if
- ' Set Color to Red
- Sys(300) = 255
- Sys(301) = 0
- Sys(302) = 0
- '
- ' Draw Number Column Values
- if Six = 1 then
- ' Text Block with 0.6
- >TextBlock
- {
- <Distance [SP]
- <TextBegin
- <Text " "
- <Text [MTeeN2$]
- <Text [CNC122$]
- <Text [CN62$]
- <Text [STFix2$]
- <Text [RodsT2$]
- <Text [RodsB2$]
- <Text [Chan2$]
- <justification 1
- <pointxyz [HTH * 8], 0, 0
- }
- else
- ' Text block without 0.6
- >TextBlock
- {
- <Distance [SP]
- <TextBegin
- <Text " "
- <Text [MTeeN2$]
- <Text [CNC122$]
- <Text " "
- <Text [STFixC2$]
- <Text [RodsT2$]
- <Text [RodsB2$]
- <Text [Chan2$]
- <justification 1
- <pointxyz [HTH * 8], 0, 0
- }
- end if
- ' Draw CTS Column Values
- if Six = 1 then
- ' Text Block with 0.6
- >TextBlock
- {
- <Distance [SP]
- <TextBegin
- <Text " "
- <Text [MTeeC2$]
- <Text [CN122$]
- <Text [CN6C2$]
- <Text [STFixC2$]
- <Text [RodsTC2$]
- <Text [RodsBC2$]
- <Text [Chan2C$]
- <justification 1
- <pointxyz [HTH * 16], 0, 0
- }
- else
- ' Text Block without 0.6
- >TextBlock
- {
- <Distance [SP]
- <TextBegin
- <Text " "
- <Text [MTeeC2$]
- <Text [CN122$]
- <Text " "
- <Text [STFix2C$]
- <Text [RodsTC2$]
- <Text [RodsBC2$]
- <Text [Chan2C$]
- <justification 1
- <pointxyz [HTH * 16], 0, 0
- }
- end if
- ' Set Color back to normal
- Sys(300) = ccRed
- Sys(301) = ccGreen
- Sys(302) = ccBlue
- '
- ' Text Title Block for Ref
- >TextBlock
- {
- <Distance [SP]
- <Style 0
- <TextBegin
- <Text "Ref"
- <justification 1
- <pointxyz 0, 0, 0
- }
- ' Text Block for No
- >TextBlock
- {
- <Distance [SP]
- <TextBegin
- <Style 0
- <Text "no"
- <justification 1
- <pointxyz [HTH * 8], 0, 0
- }
- ' Text block for cts
- >TextBlock
- {
- <Distance [SP]
- <TextBegin
- <Style 0
- <Text "cts"
- <justification 1
- <pointxyz [HTH * 16], 0, 0
- }
- ' Set Current Line Type to Zero
- Sys(6) = 0
- '
- ' Draw Title Block Box
- >Box
- {
- <Pointxyz [-TH*2], [TH/2], 0
- <Pointrel [TH*12], [-TH*2], 0
- }
- '
- ' Draw First 3 value Box
- >Box
- {
- <Pointxyz [-TH*2], [-TH*1.5], 0
- <Pointrel [TH*12], [-TH*6], 0
- }
- '
- ' Update Current Y Value
- CurY = TH*1.5
- CurY = CurY + TH*6
- '
- ' Draw second 3 value Box
- >Box
- {
- <Pointxyz [-TH*2], [-CurY], 0
- <Pointrel [TH*12], [-TH*6], 0
- }
- '
- ' Update Current Y Value
- CurY = CurY + TH*6
- '
- ' Draw Channel Box
- >Box
- {
- <Pointxyz [-TH*2], [-CurY], 0
- <Pointrel [TH*12], [-TH*2], 0
- }
- '
- ' Update Current Y Value
- CurY = CurY + TH*2
- '
- ' Draw Left Column Line
- >Line
- {
- <Pointxyz [TH*2], [TH/2], 0
- <Pointxyz [TH*2], [-CurY], 0
- }
- '
- ' Draw Right Column Line
- >Line
- {
- <Pointxyz [TH*6], [TH/2], 0
- <Pointxyz [TH*6], [-CurY], 0
- }
- '
- ' Assign Panels from earlier
- ' PanNum = Panels
- ' EEE
- ' Divide by however many the user says are in a carton
- NewNum = Pan3 / PanNum
- ' Round the Result up since we need the next full carton
- ' Precision 1
- ' NewNum$ = NewNum
- ' a$ = RIGHT$(NewNum, 1)
- ' if a$ = "0" then goto Done2
- ' Precision 0
- ' NewNum2 = NewNum
- ' NewNum = NewNum2 + 1
- Done2:
- Precision 1
- NewNum3 = NewNum
- NewNum2$ = NewNum3,"cts"
- Precision 2
- ' Select Object when Created is on
- Sys(242) = 1
- '
- ' Print Panels at info box bottom
- >Text2D
- {
- <justification 2
- <size [TH]
- <text "Panels"
- <angle 0
- <Pointxyz [TH*3.5], [-CurY-TH*2], 0
- }
- ' Select Object when Created is off
- Sys(242) = 0
- ' Get Current Max X values to place labled behind the text values
- M = Sys(198)
- M = M + .5
- N = TH * 4 + M
- ' Set Color to Red
- Sys(300) = 255
- Sys(301) = 0
- Sys(302) = 0
- ' Add Carton # and cts
- >Text2D
- {
- <justification 0
- <size [TH]
- <text [NewNum2$]
- <angle 0
- <Pointxyz [M], [-CurY-TH*2], 0
- }
- ' Reset Color
- Sys(300) = ccRed
- Sys(301) = ccGreen
- Sys(302) = ccBlue
- '
- ' Select All
- >SelectAll
- {
- }
- ' Copy Area Box back into main drawing
- >Copy
- {
- }
- '
- ' Close Temp Drawing
- >Close
- {
- <SaveChanges 0
- }
- '
- ' Refresh the Screen
- >Regenerate
- {
- }
- ' Back to Layer 11
- Layer(11) = 14
- '
- ' Paste the info box in again
- >Paste
- {
- <Type 0
- ' 0 = Changeable scale (based on distance between handles 1 and 2); 1 = Fixed scale (always paste at original size)
- <SelectOnly 0
- '
- ' 0 = select the pasted object; 1 = leave the pasted object unselected
- <pointxyz 0,0,0
- }
- '
- ' Select Layer 11
- >SelectLayer
- {
- <Layer 11
- }
- ' Get Min and Max of the current Selection
- MinX = Sys(196)
- MinY = Sys(197)
- MaxX = Sys(198)
- MaxY = Sys(199)
- ' Set Handle
- >SetHandle
- {
- <pointxyz [MinX,MinY],0
- <pointxyz [MaxX,MinY],0
- }
- ' Loop for Moving Box from Layer 11 to the current layer
- for a = 1 to Sys(9)
- getattr a, type, select, laynum, group, red, green, blue
- if laynum = 11 then laynum = 10
- Putattr a, type, select, laynum, group, red, green, blue
- next a
- ' Switch to and Name Layer 10
- Sys(3) = 10
- Sys$(93) = "6x6 Material Boxes"
- '
- ' Silent Mode Off
- Sys(36) = 0
- '
- ' Refresh the Drawing
- >Regenerate
- {
- }
- ' Move the Box
- >Move
- {
- <Type 0
- }
- '
- ' Refresh the Screen to see text in area box
- >Regenerate
- {
- }
- '
- ' Deselect the Box after it's been placed
- >PointSelect
- {
- <Type 0
- <pointxyz -100, -100, 100
- }
- '
- ' Return to previous Current Layer
- Sys(3) = CurLay
- '
- end
-
- ' Select Layer 10
- >SelectLayer
- {
- <Layer 10
- }
- '
- ' Set Info Box Handles
- >SetHandle
- {
- <Pointxyz [-TH*2], [-CurY], 0
- <Pointxyz [TH*10], [-CurY], 0
- }
- ' Loop for Moving Box from Layer 11 to the LLay layer
- for a = 1 to Sys(9)
- getattr a, type, select, laynum, group, red, green, blue
- if laynum = 11 then laynum = LLay
- Putattr a, type, select, laynum, group, red, green, blue
- next a
- if LLay = 10 then
- ' Make Layer 10 Current and name it
- Layer(10) = 14
- Sys$(93) = "6x6 Info Boxes"
- else
- ' Make Layer 14 Current and name it
- Layer(14) = 14
- Sys$(93) = "6x6 Summary Box"
- endif
- ' Silent Mode Off
- Sys(36) = 0
- '
- ' Refresh the Screen
- >Regenerate
- {
- }
- '
- ' Move the Box
- >Move
- {
- <Type 0
- }
- '
- ' Refresh the Screen
- >Regenerate
- {
- }
- '
- ' Deselect the Box after it's been placed
- >PointSelect
- {
- <Type 0
- <pointxyz -100, -100, 100
- }
- '
- ' Return to previous Current Layer
- Sys(3) = CurLay
- '
- ' Program Finished at this point
- end
-